Repository navigation
Version handling: Maven versions, ranges, no pre-releases, errors are reported - #11
Conversation
|
@cla-assistant[bot] check |
|
Review of the version handling (read the diff, did not run it). Overall: the approach is right. It fixes the real causes (Maven spelling in
CI: no |
… reported - toVersion accepts the Maven spelling of a version (33.8.0-jre, 2.17, 3.0-rc5) - getBundleAsURL tries the version as given first, then the OSGi spelling and 2.17 for 2.17.0 - latestVersion only returns a version inside the range and skips pre-releases (rc, alpha, beta, snapshot, milestones, ...) unless the range asks for one; it throws with the reason instead of returning null - a missing bundle or package keeps the whole range of the requirement (bundle-version>=X is not the exact version X), the newest local match is used before anything is downloaded - when the dependencies cannot be loaded, the reasons are part of the exception - downloads have a read timeout and use a unique temp file, the readers cache is a ConcurrentHashMap - packages of jackson-core, jackson-databind and guava failureaccess are mapped to their bundles, and a package is mapped to a bundle with the same name
- drop the null-range fallback in loadMissing, so a package range cannot load an out-of-range bundle; local jars still have to export the package in range - latestVersion only considers the same flavour (jre or android) when the range asks for one - add unit tests for isPreRelease, toRange, getMavenVersions, flavour and the unmapped lower-bound limitation; the isPreRelease table has no false positives, so the regex is unchanged - document toVersion extra segments and overflow, and point addFelixDefaults at the system-property override in framework() - keep the best jar version in a variable instead of re-reading manifests
862ea5a to
7b5608d
Compare
|
I've addressed the review comments and rebased onto
What's left: the CLA check is still pending. The CFML tests still need a published Lucee 9 core with lucee/Lucee#3816 (LDEV-6948); the newest one on maven.lucee-services.com is still |
Builds on #10 (Felix configuration), this branch contains that commit as well, review/merge #10 first. The change of this PR is the second commit.
Version handling in the bundle resolver:
BundleProvider.toVersionaccepts the Maven spelling of a version:33.8.0-jrebecomes33.8.0.jre,2.17becomes2.17.0,3.0-rc5becomes3.0.0.rc5. Before,33.8.0-jrefailed withFor input string: "0-jre".getBundleAsURLtries the version as given first (the Maven spelling,33.8.0-jre), then the OSGi spelling, and2.17for2.17.0. Before, it only used the OSGi spelling (33.8.0.jre), which does not exist on Maven.latestVersion(name, range)reads all versions frommaven-metadata.xmland returns the newest one inside the range. Pre-releases (rc, alpha, beta, snapshot, milestones likeM1,ea,preview, ...) are skipped unless the range itself asks for one. Before, it returned<release>/<latest>, which is3.0-rc5for jackson-annotations. It now throws with the reason for each repository instead of returning null when the bundle is mapped but nothing fits.(bundle-version>=2.17.0)(!(bundle-version>=99.0.0))is[2.17.0,99.0.0)and not the exact version2.17.0. The newest installed or local bundle inside the range is used (bundle directory and the additional directories) before anything is downloaded. Bundles found in the bundle directory for a missing package must also export the package in a version inside the range.failed to load what is missing: ...).readerscache is aConcurrentHashMap.com.fasterxml.jackson.core,com.fasterxml.jackson.databindandcom.google.common.util.concurrent.internal(guava failureaccess), and a package is mapped to a bundle with the same name when there is one (likecom.google.gson).Local results, the tests from #9, with a 9.0 core that has lucee/Lucee#3816 (LDEV-6948):
With 9.0.0.1487-ALPHA all of them pass except "is actually active". The core tests with the label
osgifrom 9.0 with lucee/Lucee#3816 pass as well with the extension installed (OSGiExtensions,RemovedBundles,ShadedAsm,VersionImpl,LDEV6948).CI on
mainneeds a core with lucee/Lucee#3816 before "is actually active" can pass.